From: Jim Blandy Date: Tue, 18 May 1993 22:45:29 +0000 (+0000) Subject: * sysdep.c (reset_sys_modes): Test the return value of X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~96187 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=1334b321d60d0ce12936fb5f50ad621e9308e0f0;p=emacs.git * sysdep.c (reset_sys_modes): Test the return value of EMACS_SET_TTY properly. * systty.h (EMACS_GET_TTY, EMACS_SET_TTY): Document the return values. --- diff --git a/src/sysdep.c b/src/sysdep.c index c139eed5d8f..a6c1bdfbb34 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1241,7 +1241,7 @@ reset_sys_modes () reset_sigio (); #endif /* BSD4_1 */ - while (! EMACS_SET_TTY (input_fd, &old_tty, 0) && errno == EINTR) + while (EMACS_SET_TTY (input_fd, &old_tty, 0) < 0 && errno == EINTR) ; #ifdef AIX diff --git a/src/systty.h b/src/systty.h index 7e416f05e2b..0123fbbae2e 100644 --- a/src/systty.h +++ b/src/systty.h @@ -244,14 +244,16 @@ static struct sensemode { emacs_tty should contain an element for each parameter struct that Emacs may change. - EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the - parameters of the tty on FD in *P. + EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the parameters + of the tty on FD in *P. Return zero if all's well, or -1 if we ran + into an error we couldn't deal with. EMACS_SET_TTY (int FD, struct emacs_tty *P, int waitp) sets the parameters of the tty on FD according to the contents of *P. If waitp is non-zero, we wait for all queued output to be written before making the change; otherwise, we forget any queued input and make the change immediately. + Return 0 if all went well, and -1 if anything failed. EMACS_TTY_TABS_OK (struct emacs_tty *P) is false iff the kernel expands tabs to spaces upon output; in that case, there is no @@ -259,13 +261,9 @@ static struct sensemode { /* For each tty parameter structure that Emacs might want to save and restore, - - include an element for it in this structure, - - define a pair of numbered macros to get and set it and return - true iff the call succeeded, - - give alternative definitions for when the component is not implemented - which always succeed, and - - extend the definition of EMACS_{GET,SET}_TTY_CHARS to include the - new macros. */ + - include an element for it in this structure, and + - extend the emacs_{get,set}_tty functions in sysdep.c to deal with the + new members. */ struct emacs_tty {